package com.ticket.sass.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ticket.sass.admin.mapper.DouyinGoodMapper;
import com.ticket.sass.admin.service.BaseService;
import com.ticket.sass.common.entity.tenant.DouyinGoodEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ywb
 * @since 2024-07-19
 */
@Service
public class DouyinGoodServiceImpl extends ServiceImpl<DouyinGoodMapper, DouyinGoodEntity> implements BaseService<DouyinGoodEntity> {
    public Map<String, DouyinGoodEntity> productIdMap() {
        QueryWrapper<DouyinGoodEntity> queryWrapper = new QueryWrapper<>();
        
        List<DouyinGoodEntity> list = list(queryWrapper);
        return list.stream()
            .collect(Collectors.toMap(DouyinGoodEntity::getProductId, entity -> entity));
    }
}
